<?

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
#	FILE:			includes/constants.php
#	FUNCTION:		Constants for the site
#	AUTHOR:			Cameron Morrow
#	CREATED:		26/07/2005
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Show Errors
$SHOW_ERROR_FEEDBACK = true;

# Show SQL Commands
$SHOW_SQL_FEEDBACK = false;

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# F I L E   R E L A T E D
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# File Type Array
$FILE_TYPES_ARRAY = array(
	array("jpg", "png", "gif", "jpeg"),
	array("pdf", "doc", "rtf", "txt", "xls", "ppt", "zip", "rar", "html", "htm", "php", "asp")
);

# File Type Name Array
$FILE_TYPE_NAMES_ARRAY = array("Images", "Documents", "Other");

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# S E C T I O N   R E L A T E D
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Top level folders that are NOT sections
$NON_SECTION_FOLDERS = array("assets", "includes", "Resources", "newsletters", "site_specific");

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# P R O P E R T I E S   R E L A T E D
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Property Types
$PROPERTY_TYPE_ARRAY = array("Not Set", "Auto-number", "Number", "Text", "Long Text");

# Property types in the database
$PROPERTY_TYPE_DB_ARRAY = array("", "INT", "INT", "VARCHAR(255)", "TEXT");


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# P A G E - S T A T U S   R E L A T E D
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

$PAGE_STATUS_NAMES_ARRAY = array("Unapproved", "Approved", "Locked","Removed");


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# L O G   R E L A T E D
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

$LOG_TYPES = array(
	-1 => "Undefined",
	0 => "User Logged In",
	1 => "User Logged Out",
	2 => "User Added",
	3 => "User Modified via Admin",
	4 => "User Modified via Prefs",
	5 => "User changed password (admin)",
	6 => "User changed password (prefs)",
	7 => "User Deleted",
	8 => "Page added",
	9 => "Page edited",
	10 => "Page content edited",
	11 => "Page deleted",
	12 => "Pages moved",
	13 => "Group added",
	14 => "Group modified",
	15 => "Group users modified",
	16 => "Group deleted",
	17 => "Uploaded file added",
	18 => "Uploaded file deleted",
	19 => "Section added",
	20 => "Section changed",
	21 => "Section deleted",
	22 => "Newsletter group added",
	23 => "Newsletter group modified",
	24 => "Newsletter group users modified",
	25 => "Newsletter group deleted",
	26 => "Newsletter added",
	27 => "Newsletter modified",
	28 => "Newsletter content modified",
	29 => "Newsletter deleted",
	30 => "Newsletter sent",
	31 => "Table Property added",
	32 => "Table Property modified",
	33 => "Table Property deleted",
	34 => "PayPal Instant Payment Notification - Checking Approval",
	35 => "PayPal Instant Payment Notification - Approved",
	36 => "PayPal Instant Payment Notification - Failed",
	37 => "PayPal Instant Payment Notification - Couldn't Access"
);

$LOG_TYPE_GROUPS = array(
	"loginout" => array(
		"groups" => array(0, 1),
		"name" => "Logging In/Out"),
	"users" => array(
		"groups" => array(2, 3, 4, 5, 6, 7),
		"name" => "Users"),
	"pages" => array(
		"groups" => array(8, 9, 10, 11, 12),
		"name" => "Pages"),
	"groups" => array(
		"groups" => array(13, 14, 15, 16),
		"name" => "Groups"),
	"uploads" => array(
		"groups" => array(13, 14, 15, 16),
		"name" => "Uploaded Files"),
	"sections" => array(
		"groups" => array(19, 20, 21),
		"name" => "Sections"),
	"newsletters" => array(
		"groups" => array(22, 23, 24, 25, 26, 27, 28, 29, 30),
		"name" => "Newsletters"),
	"properties" => array(
		"groups" => array(31, 32, 33),
		"name" => "Properties")
);


# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# T A B L E S   R E L A T E D
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

$DATABASE_TABLES = array_values($PROJECT_DB_TABLES);

# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# M I S C
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

$YES_NO_ARRAY = array("No", "Yes");

# Server and Script names
# Check for CGI
if (strpos($_SERVER["SCRIPT_NAME"], "cgi-bin") === false) {
	$SCRIPT_NAME = strtolower($_SERVER["SCRIPT_NAME"]);
} else {
	$SCRIPT_NAME = strtolower($_SERVER["PATH_TRANSLATED"]);
}
$SERVER_NAME = strtolower($_SERVER["SERVER_NAME"]);


# Name of Newsletters directory
$NEWSLETTER_DIR_NAME = "newsletters";

# Number of results on a page when browsing
$ADMIN_BROWSING_PAGE_RESULTS = 20;

# Page link tolerance - number of pages before and after current page to display
$PAGE_LINK_TOLERANCE = 8;

if(!isset($_SERVER["REQUEST_URI"])) {
	if (@is_string($_SERVER["argv"][0])) {
		$_SERVER["REQUEST_URI"] = substr($_SERVER["argv"][0], strpos($_SERVER["argv"][0], ";") + 1);
	} else {
		$_SERVER["REQUEST_URI"] = "http://localhost/";
	}
}
?>